package org.luxor.commons.workflow.entity;

import org.luxor.commons.workflow.enums.RejectType;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 驳回任务
 *
 * @author Mr.yan  @date 2022/8/5
 */
public class RejectTask {

    /**
     * 任务ID
     */
    @NotBlank(message = "任务ID(taskId)，不能为空")
    private String taskId;

    /**
     * 办理人
     */
    @NotBlank(message = "办理人(userId)，不能为空")
    private String userId;

    /**
     * 驳回类型
     */
    @NotNull(message = "驳回类型(rejectType)，不能为空")
    private RejectType rejectType;

    /**
     * 驳回的任务办理后,快速回到当前节点？
     */
    private Boolean quickReturn;

    /**
     * 驳回原因
     */
    private String reason;

    /**
     * 目标节点ID
     */
    private String targetActivityId;

    public RejectTask() {
        this.quickReturn = Boolean.FALSE;
    }

    public RejectTask(String taskId, String userId, RejectType rejectType) {
        this();
        this.taskId = taskId;
        this.userId = userId;
        this.rejectType = rejectType;
    }

    public RejectTask(String taskId, String userId, RejectType rejectType, String targetActivityId) {
        this();
        this.taskId = taskId;
        this.userId = userId;
        this.rejectType = rejectType;
        this.targetActivityId = targetActivityId;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public RejectType getRejectType() {
        return rejectType;
    }

    public void setRejectType(RejectType rejectType) {
        this.rejectType = rejectType;
    }

    public boolean getQuickReturn() {
        return quickReturn;
    }

    public void setQuickReturn(boolean quickReturn) {
        this.quickReturn = quickReturn;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getTargetActivityId() {
        return targetActivityId;
    }

    public void setTargetActivityId(String targetActivityId) {
        this.targetActivityId = targetActivityId;
    }

    @Override
    public String toString() {
        return "RejectTask{" +
                "taskId='" + taskId + '\'' +
                ", userId='" + userId + '\'' +
                ", rejectType=" + rejectType +
                ", quickReturn=" + quickReturn +
                ", reason='" + reason + '\'' +
                ", targetActivityId='" + targetActivityId + '\'' +
                '}';
    }
}
